import React from "react";

class Item extends React.Component {
  constructor(props) {
    super(props);
    this.handleItemClick = this.handleItemClick.bind(this)
  }
  render() {
    const { content } = this.props;
    return (
      <li onClick={this.handleItemClick}>{content}</li>
    )
  }
  handleItemClick() {
    const { deleteItem, index } = this.props;
    deleteItem(index);
  }
}

export default Item;